import zipfile
import os
from collections.abc import Callable

def is_chinese(char):
    return '\u4e00' <= char <= '\u9fff'

def unzip(
    zip_file_path: str,
    target_dir: str,
    check_filename_fn: Callable[[str], bool] = lambda s: True
):
    with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
        file_list = zip_ref.namelist()
        for file in file_list:
            normpath = os.path.normpath(file)
            is_safe_path = not normpath.startswith('..')
            if is_safe_path and check_filename_fn(normpath):
                zip_ref.extract(file, target_dir)
